<?php 
namespace app\api\controller\v1;
use app\api\service\AllianceService;

class Alliance extends Base {
    
    protected $service;
    public function __construct(AllianceService $service)
    {
        parent::__construct();
        $this->service = $service;
    }

    // 显示
    public function index($page = 1, $size = 10) {
        return show(1, '成功', $this->service->page($page, $size), 200);
    }
    
    // 获取审核意见
    public function getYj($id) {
        return $this->service->getYj($id);
    }

    // 获取一条加盟信息
    public function one($id) {
        return $this->service->one($id);
    }
    
    // 审核
    public function check() {
        return $this->service->check();
    }
    // 提交审核
    public function checkIn() {
        return $this->service->checkIn();
    }
    // 新增
    public function add() {
        return $this->service->add();
    }

    // 更新
    public function save() {
        return $this->service->save();
    }

    // 删除
    public function delete($id) {
        return $this->service->delete($id);
    }

    // 加盟商列表
    public function getList() {
        return $this->service->getList();
    }

    // 获取开店状态
    public function getOpen($alliance_id) {
        return $this->service->getOpen($alliance_id);
    }
    
    // 修改开店状态
    public function setOpen($alliance_id) {
        return $this->service->setOpen($alliance_id);
    }
}